package com.core.sendAgent.bo;

import java.util.List;

import javax.annotation.Resource;

import org.apache.log4j.Logger;
import org.springframework.stereotype.Service;

import com.common.web.SelectJson;
import com.core.sendAgent.dao.SendAgentDao;
import com.core.sendAgent.dto.SendAgentSearchCondition;

@Service
public class SendAgentBo {
	protected Logger log = Logger.getLogger(this.getClass());
	@Resource
	private SendAgentDao sendAgentDao;
	
	public SendAgentSearchCondition getById(SendAgentSearchCondition sc) {
		return sendAgentDao.getById(sc.getId());
	}
	public SendAgentSearchCondition getById2(Long id) {
		return sendAgentDao.getById(id);
	}
	public String getNameById(Long id){
		SendAgentSearchCondition temp=sendAgentDao.getNameById(id);
		String nameString =temp.getSendAgentName();
		return nameString;
	}
	public void add(SendAgentSearchCondition sc){
		sendAgentDao.add(sc);
	}
	
	public void update (SendAgentSearchCondition sc){
		sendAgentDao.update(sc);
	}
	
	public void del (String id){
		sendAgentDao.del(id);
	}
	//其他界面应用的搜索
	public List<SelectJson> searchDtoList(SendAgentSearchCondition sc){
		return  sendAgentDao.searchDtoList(sc);
	}
	//获取展示页的数据
	public List<SendAgentSearchCondition> getAgentSearchConditions(SendAgentSearchCondition sc){
		return sendAgentDao.getAgentSearchConditions(sc);
	}
	//获取所有记录
	public Integer getAllRecodeCnt(SendAgentSearchCondition sc){
		return sendAgentDao.getAllRecodeCnt(sc);
	}
}
